package InterfaceGrafica;

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;

import Acoes.AcaoDePausar;
import Acoes.AcaoDeProximoEvento;

public class PainelDePassagemDeTempo extends Painel {

	private JButton botaoDePausa = null;
	private JButton botaoDeAvancar = null;
	private JLabel titulo = null;
	
	public PainelDePassagemDeTempo (JanelaPrincipal jp) {
		this.setBounds(235, 10, 305, 75);
		this.setLayout(null);
		this.setBorder(BorderFactory.createLineBorder(Color.black));
		this.titulo = super.criaTitulo("Painel de Passagem de Tempo");
		this.titulo.setBounds(10, 5, 200, 25);
		this.add(titulo);
		this.botaoDePausa = criaBotaoDePausa();
		this.botaoDePausa.setBounds(10, 35, 140, 25);
		this.add(botaoDePausa);
		this.botaoDeAvancar = criaBotaoDeAvancar(jp);
		this.botaoDeAvancar.setBounds(155, 35, 140, 25);
		this.add(botaoDeAvancar);
	}
	
	private JButton criaBotaoDePausa () {
		JButton botao = new JButton();
		botao.setAction(new AcaoDePausar(this));
		botao.setText("Pausar");
		return botao;
	}
	
	private JButton criaBotaoDeAvancar (JanelaPrincipal jp) {
		JButton botao = new JButton();
		botao.setAction(new AcaoDeProximoEvento(jp));
		botao.setText("Proximo Evento");
		return botao;
	}
	
	public void setTextoBotaoDePausa (boolean b) {
		if (b){
			botaoDePausa.setText("Continuar");
		} else {
			botaoDePausa.setText("Pausar");
		}
	}

}
